package com.xuecheng.content.convert;

import com.xuecheng.api.content.model.dto.TeachplanMediaDTO;
import com.xuecheng.api.content.model.vo.BindTeachplanMediaVO;
import com.xuecheng.content.entity.TeachplanMedia;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Created on 2021/03/31/17:02 周三
 *
 * @author Lantin
 */
@Mapper
public interface TeachplanMediaConvert {


    TeachplanMediaConvert INSTANCE = Mappers.getMapper(TeachplanMediaConvert.class);

    @Mapping(source = "id", target = "teachplanMediaId")
    TeachplanMediaDTO teachplanMediaToDTO(TeachplanMedia teachplanMedia);

    @Mapping(source = "teachplanMediaId", target = "id")
    TeachplanMedia dtoToTeachPlanMedia(TeachplanMediaDTO dto);

    TeachplanMediaDTO voToTeachplanMediaDTO(BindTeachplanMediaVO vo);

    List<TeachplanMediaDTO> teachplanMediaToDTOList(List<TeachplanMedia> teachplanMedia);
}
